LOCAL_PATH:= $(call my-dir)
################################## libaudioplayernativelib.so ################################
include $(CLEAR_VARS)

LOCAL_MODULE:= libaudioplayernativelib
LOCAL_CFLAGS += -fstack-protector-strong -fno-common -pipe -Wno-inconsistent-missing-override
LOCAL_SRC_FILES:=           \
        audioplayernativelib/src/main/cpp/audioplayernativelib.cpp

LOCAL_MODULE_TAGS := optional

LOCAL_SHARED_LIBRARIES :=   \
        libutils            \
        libcutils           \
        liblog              \
        libtinyalsa


LOCAL_C_INCLUDES :=                \
        $(JNI_H_INCLUDE)            \
        $(LOCAL_PATH)/..            

#LOCAL_PROPRIETARY_MODULE := true
LOCAL_CERTIFICATE := platform
LOCAL_HEADER_LIBRARIES := jni_headers

LOCAL_CFLAGS += -DBUILD_TO_ANDROID_OS
LOCAL_C_INCLUDES += $(TOP)/libnativehelper/include/nativehelper

include $(BUILD_SHARED_LIBRARY)

#################################### AudioPlayerNativeLib.jar ###############################
include $(CLEAR_VARS)
LOCAL_MODULE := AudioPlayerNativeLib
LOCAL_MULTILIB := both
LOCAL_MODULE_TAGS := optional
LOCAL_PRIVATE_PLATFORM_APIS := true
#LOCAL_JAVA_LIBRARIES += 
#LOCAL_STATIC_JAVA_LIBRARIES := 
LOCAL_JNI_SHARED_LIBRARIES := libaudioplayernativelib

LOCAL_PACKAGE_NAME := AudioPlayerNativeLib

LOCAL_MANIFEST_FILE := audioplayernativelib/src/main/AndroidManifest.xml

source_dir := audioplayernativelib/src/main

LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/audioplayernativelib/$(source_dir)/res
LOCAL_SRC_FILES += $(call all-java-files-under, $(source_dir))

#LOCAL_PROPRIETARY_MODULE := true
include $(BUILD_STATIC_JAVA_LIBRARY)

############################## BAudioPlayer.apk ##############################################
include $(CLEAR_VARS)
PACKAGE_MODULE_NAME := BAudioPlayer
LOCAL_MODULE_TAGS := optional
LOCAL_PRIVATE_PLATFORM_APIS := true
#LOCAL_JAVA_LIBRARIES += 
LOCAL_STATIC_JAVA_LIBRARIES := AudioPlayerNativeLib
#LOCAL_JNI_SHARED_LIBRARIES := 
LOCAL_PACKAGE_NAME := $(PACKAGE_MODULE_NAME)

LOCAL_CERTIFICATE := platform
#LOCAL_CERTIFICATE := testkey platform

LOCAL_MANIFEST_FILE := app/src/main/AndroidManifest.xml

source_dir := app/src/main

LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/$(source_dir)/res
LOCAL_SRC_FILES += $(call all-java-files-under, $(source_dir))


LOCAL_STATIC_ANDROID_LIBRARIES := \
    androidx.preference_preference \
    androidx.appcompat_appcompat

#LOCAL_PROPRIETARY_MODULE := true
include $(BUILD_PACKAGE)

